<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="记录下Linux下的V2Ray客户端和SwitchyOmega的安装设置和v2ray服务器搭建参考如下：Linux搭建V2Ray客户端 先到github上下载v2ray-linux-64.zip压缩包12wget https:&#x2F;&#x2F;install.direct&#x2F;go.shsudo bash go.sh --local .&#x2F;v2ray-linux-64.zip">
<meta property="og:type" content="article">
<meta property="og:title" content="v2ray环境搭建">
<meta property="og:url" content="http://zengzheming.gitee.io/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/index.html">
<meta property="og:site_name" content="曾哲明的博客">
<meta property="og:description" content="记录下Linux下的V2Ray客户端和SwitchyOmega的安装设置和v2ray服务器搭建参考如下：Linux搭建V2Ray客户端 先到github上下载v2ray-linux-64.zip压缩包12wget https:&#x2F;&#x2F;install.direct&#x2F;go.shsudo bash go.sh --local .&#x2F;v2ray-linux-64.zip">
<meta property="og:image" content="http://zengzheming.gitee.io/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/20200319153753.png">
<meta property="og:image" content="http://zengzheming.gitee.io/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/20200319154326.png">
<meta property="og:image" content="http://zengzheming.gitee.io/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/20200319154448.png">
<meta property="og:image" content="http://zengzheming.gitee.io/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/20200319155248.png">
<meta property="article:published_time" content="2020-03-19T14:30:15.000Z">
<meta property="article:modified_time" content="2020-03-31T13:54:41.904Z">
<meta property="article:author" content="Zengzheming">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://zengzheming.gitee.io/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/20200319153753.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://zengzheming.gitee.io/2020/03/19/v2ray环境搭建/"/>





  <title>v2ray环境搭建 | 曾哲明的博客</title>
  








<meta name="generator" content="Hexo 4.2.0"></head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">曾哲明的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">努力成为高级打杂</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/blog/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/blog/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/blog/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://zengzheming.gitee.io/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Zengzheming">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="曾哲明的博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">v2ray环境搭建</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-03-19T22:30:15+08:00">
                2020-03-19
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/" itemprop="url" rel="index">
                    <span itemprop="name">环境搭建</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>记录下Linux下的V2Ray客户端和SwitchyOmega的安装设置和v2ray服务器搭建<br>参考如下：<br><a href="https://www.wandouip.com/t5i197953/" target="_blank" rel="noopener">Linux搭建V2Ray客户端</a></p>
<h1 id="先到github上下载v2ray-linux-64-zip压缩包"><a href="#先到github上下载v2ray-linux-64-zip压缩包" class="headerlink" title="先到github上下载v2ray-linux-64.zip压缩包"></a>先到github上下载<a href="https://github.com/v2ray/v2ray-core/releases" target="_blank" rel="noopener">v2ray-linux-64.zip</a>压缩包</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">wget https:&#x2F;&#x2F;install.direct&#x2F;go.sh</span><br><span class="line">sudo bash go.sh --local .&#x2F;v2ray-linux-64.zip</span><br></pre></td></tr></table></figure>
<p>使用go.sh安装完成后会在系统中自动安装以下组件：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;usr&#x2F;bin&#x2F;v2ray&#x2F;v2ray：V2Ray 程序；</span><br><span class="line">&#x2F;usr&#x2F;bin&#x2F;v2ray&#x2F;v2ctl：V2Ray 工具；</span><br><span class="line">&#x2F;etc&#x2F;v2ray&#x2F;config.json：配置文件；</span><br><span class="line">&#x2F;usr&#x2F;bin&#x2F;v2ray&#x2F;geoip.dat：IP 数据文件</span><br><span class="line">&#x2F;usr&#x2F;bin&#x2F;v2ray&#x2F;geosite.dat：域名数据文件</span><br></pre></td></tr></table></figure><br>此脚本会配置自动运行脚本。自动运行脚本会在系统重启之后，自动运行 V2Ray。目前自动运行脚本只支持带有 Systemd 的系统，以及 Debian / Ubuntu 全系列。</p>
<p>运行脚本位于系统的以下位置：</p>
<p>/etc/systemd/system/v2ray.service: Systemd<br>/etc/init.d/v2ray: SysV</p>
<p>脚本运行完成后，你需要：</p>
<h1 id="编辑-etc-v2ray-config-json-文件来配置你需要的代理方式"><a href="#编辑-etc-v2ray-config-json-文件来配置你需要的代理方式" class="headerlink" title="编辑 /etc/v2ray/config.json 文件来配置你需要的代理方式"></a>编辑 /etc/v2ray/config.json 文件来配置你需要的代理方式</h1><p><img src="/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/20200319153753.png" alt="avatar"><br>运行 <code>service v2ray start</code> 来启动 V2Ray 进程；<br>之后可以使用 <code>service v2ray start|stop|status|reload|restart|force-reload</code> 控制 V2Ray 的运行。</p>
<h1 id="启动v2ray服务"><a href="#启动v2ray服务" class="headerlink" title="启动v2ray服务"></a>启动v2ray服务</h1><p>sudo systemctl  start  v2ray   #启动v2ray<br>sudo systemctl  status v2ray   #查看v2ray状态<br>sudo systemctl  stop   v2ray   #停止v2ray</p>
<h1 id="使用V2RAY"><a href="#使用V2RAY" class="headerlink" title="使用V2RAY"></a>使用V2RAY</h1><ul>
<li>使用SwitchyOmega插件<br>360浏览器出了Linux的版本，这里使用360浏览器，然后点击右上角的工具搜索SwitchyOmega进行安装<br><img src="/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/20200319154326.png" alt="avatar"><br>代理服务器ip设置为127.0.0.1 端口是10808<br><img src="/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/20200319154448.png" alt="avatar"><br><img src="/blog/2020/03/19/v2ray%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/20200319155248.png" alt="avatar"></li>
</ul>
<h1 id="服务器的搭建"><a href="#服务器的搭建" class="headerlink" title="服务器的搭建"></a>服务器的搭建</h1><p>服务器需要选国外的服务器，因为我是穷屌丝，这里选择国外的vps服务器，最便宜的用过cloudcone不过稳定性有时不是很好，所以目前选择的是搬瓦工</p>
<ul>
<li>服务器启动后，登陆上去，用233的一键安装脚本<code>bash &lt;(curl -s -L https://git.io/v2ray.sh)</code></li>
<li>按照步骤安装基本就可以了，这里要记下地址、端口、用户ID和alterId，在客户端的config.json进行配置</li>
</ul>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/2020/03/19/Hexo%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/" rel="next" title="Hexo环境搭建">
                <i class="fa fa-chevron-left"></i> Hexo环境搭建
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/2020/03/20/tf1-13%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/" rel="prev" title="tf1.13环境搭建">
                tf1.13环境搭建 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Zengzheming</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/%7C%7Carchive">
              
                  <span class="site-state-item-count">10</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/blog/categories/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/blog/tags/index.html">
                  <span class="site-state-item-count">5</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#先到github上下载v2ray-linux-64-zip压缩包"><span class="nav-number">1.</span> <span class="nav-text">先到github上下载v2ray-linux-64.zip压缩包</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#编辑-etc-v2ray-config-json-文件来配置你需要的代理方式"><span class="nav-number">2.</span> <span class="nav-text">编辑 &#x2F;etc&#x2F;v2ray&#x2F;config.json 文件来配置你需要的代理方式</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#启动v2ray服务"><span class="nav-number">3.</span> <span class="nav-text">启动v2ray服务</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#使用V2RAY"><span class="nav-number">4.</span> <span class="nav-text">使用V2RAY</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#服务器的搭建"><span class="nav-number">5.</span> <span class="nav-text">服务器的搭建</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Zengzheming</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/blog/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  

</body>
</html>
